package org.nox.helloseries.core.services.recherche.impl;

import org.nox.helloseries.core.services.recherche.FTPSearchService;
import org.nox.helloseries.core.services.recherche.SearchService;
import org.nox.helloseries.core.services.recherche.TrackerSearchService;
import org.nox.helloseries.factory.HelloSeriesServiceFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DefaultSearchService implements SearchService
{
    private static Logger LOG = LoggerFactory.getLogger( DefaultSearchService.class );

    // Récupération des services

    private TrackerSearchService trackerSearchService = HelloSeriesServiceFactory.createOrGetService( TrackerSearchService.class );

    private FTPSearchService fTPSearchService = HelloSeriesServiceFactory.createOrGetService( FTPSearchService.class );

    public void searchFTPAndTorrent()
    {
        LOG.info( "Début de la recherche" );

        trackerSearchService.searchAll();

        fTPSearchService.searchAll();

        LOG.info( "Recherche terminée" );
    }
}
